package md.lanjing.com.module_wallet.ui.activity;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.lxh.baselibray.base.XActivity;
import com.lxh.baselibray.constant.ARouterConfig;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import md.lanjing.com.module_wallet.R;
import md.lanjing.com.module_wallet.R2;
import md.lanjing.com.module_wallet.ui.adapter.CommonFragmentPagerAdapter;
import md.lanjing.com.module_wallet.ui.fragment.ChargeDrawRecordFragment;
import md.lanjing.com.module_wallet.ui.fragment.ExchangeRecordFragment;
import md.lanjing.com.module_wallet.ui.fragment.TransferRecordFragment;

public class RecordActivity extends XActivity {
    @BindView(R2.id.tabLayout)
    TabLayout tabLayout;
    @BindView(R2.id.viewPager)
    ViewPager viewPager;

    @Override
    public void initData(Bundle savedInstanceState) {
        List<Fragment> fragmentList=new ArrayList<>();
        fragmentList.add(ChargeDrawRecordFragment.newInstance(1));
        fragmentList.add(ChargeDrawRecordFragment.newInstance(2));
        fragmentList.add(new TransferRecordFragment());
        fragmentList.add(new ExchangeRecordFragment());
        String titleArr[]=new String[]{"充币","提币","转帐","兑换"};
        CommonFragmentPagerAdapter adapter=new CommonFragmentPagerAdapter(getSupportFragmentManager(),fragmentList,titleArr);
        viewPager.setAdapter(adapter);
        tabLayout.setupWithViewPager(viewPager);
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_record;
    }


}
